//
//  ChainNetAPIClient.h
//  Chain
//
//  Created by zhaosh on 2018/3/30.
//  Copyright © 2018年 zhaosh. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

typedef void(^postEdit)(NSMutableDictionary *EditReadyDic);

typedef NS_ENUM(NSUInteger, NetworkMethod) {
    Get,
    Post,
    Put,
    Delete
};

@interface ChainNetAPIClient:AFHTTPSessionManager

+(ChainNetAPIClient *)sharedJsonClient;
+(void)saveCookieData;
+(void)removeCookieData;

- (void)requestJsonDataWithPath:(NSString *)aPath
                     withParams:(NSDictionary*)params
                 withMethodType:(NSUInteger)NetworkMethod
                       andBlock:(void (^)(id data, NSError *error))block;

-(void)postRequestJsonDataWithPath:(NSString *)aPath
                        withParams:(NSDictionary* )params
                        withHeader:(NSDictionary *)header
                          andBlock:(void (^)(id data, NSError *error))block;

- (void)uploadImage:(UIImage *)image path:(NSString *)path name:(NSString *)name
       successBlock:(void (^)(NSURLSessionDataTask *operation, id responseObject,NSMutableDictionary *prams))success
       failureBlock:(void (^)(NSURLSessionDataTask *operation, NSError *error))failure
      progerssBlock:(void (^)(NSProgress * _Nonnull uploadProgress))progress;
@end
